package org.xm.sk.vo.ob;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.xm.sk.vo.e.BoderStatus;
import org.xm.sk.vo.tb.Boder;
import org.xm.sk.vo.tb.Item;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@ApiModel(value = "UnBoder4Hairdresser", description = "未完成订单")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UnBoder4Hairdresser {

    @ApiModelProperty(value = "订单ID")
    Integer id;

    @ApiModelProperty(value = "预约号")
    String ordernum;

    @ApiModelProperty(value = "客户名称")
    String username;

    @ApiModelProperty(value = "客户昵称")
    String nickname;

    @ApiModelProperty(value = "客户头像图片ID")
    Integer imageId;

    @ApiModelProperty(value = "预约项目ID集")
    Set<Integer> itemIds = new HashSet<Integer>(0);

    @ApiModelProperty(value = "预约项目名称集")
    Set<String> itemNames = new HashSet<String>(0);

    @ApiModelProperty(value = "预约电话")
    String phone;

    @ApiModelProperty(value = "下单时间")
    Date createdate;

    @ApiModelProperty(value = "预约时间")
    Date mkTime;

    @ApiModelProperty(value = "订单状态")
    BoderStatus status;

    public UnBoder4Hairdresser(Integer id, String ordernum, String username,
            String nickname, Integer imageId, Boder boder, String itemNs,
            String phone, Date createdate, Date mkTime, BoderStatus status) {
        this.id = id;
        this.ordernum = ordernum;
        this.username = username;
        this.nickname = nickname;
        this.imageId = imageId;
        for (Item item : boder.getItems()) {
            this.itemIds.add(item.getId());
        }
        if (null != itemNs && 0 < itemNs.length()) {
            String[] items = itemNs.split(",");
            for (String s : items) {
                this.itemNames.add(s);
            }
        }
        this.phone = phone;
        this.createdate = createdate;
        this.mkTime = mkTime;
        this.status = status;
    }

}
